﻿#ifndef NETWORKHOSTINFO_H
#define NETWORKHOSTINFO_H

#include <QWidget>
#include <QAbstractSocket>
#include <QHostInfo>

namespace Ui {
class NetworkHostInfo;
}

class NetworkHostInfo : public QWidget
{
    Q_OBJECT

public:
    explicit NetworkHostInfo(QWidget *parent = nullptr);
    ~NetworkHostInfo();

private:
    /**
     * @brief protocalName 通过协议类型返回协议名称
     * @param protocol 协议类型
     * @return 协议名称
     */
    QString protocalName(QAbstractSocket::NetworkLayerProtocol protocol);

private slots:
    void slotLookupHostInfo(const QHostInfo& hostInfo);

private slots:
    void on_btnGetLocal_clicked();

    void on_btnClear_clicked();

    void on_btnSearch_clicked();

    void on_btnAllInterface_clicked();

    void on_btnAllAddress_clicked();

private:
    Ui::NetworkHostInfo *ui;
};

#endif // NETWORKHOSTINFO_H
